# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Claudio Riva <firetux83@gmail.com>

pkgname=hyena
pkgver=0.5
pkgrel=6
pkgdesc="Library for creating C Sharp applications"
arch=('any')
url="https://wiki.gnome.org/Hyena"
license=('MIT')
depends=('gtk-sharp-2')
source=(https://download.gnome.org/sources/$pkgname/$pkgver/$pkgname-$pkgver.tar.bz2
        fix-build.patch)
sha256sums=('eb7154a42b6529bb9746c39272719f3168d6363ed4bad305a916ed7d90bc8de9'
            '7528a78b710c253d787c3cc8239d42f85290bad9253eb0575b87d9dd9034609b')

prepare() {
  cd $pkgname-$pkgver

  # Fix build
  # https://bugzilla.gnome.org/show_bug.cgi?id=633333
  patch -Np1 -i "$srcdir/fix-build.patch"

  sed -i 's/gmcs/mcs/
          s/2\.0/2.0-api/' build/m4/shamrock/mono.m4

  aclocal -I build/m4/shamrock
  automake --gnu
  autoconf
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
